package com.henme.crm.util.mybatis;

import com.henme.crm.util.page.Page;


public class MySQLDialect implements Dialect {

    @Override
    public String getLimitString(Page page, String sql) {
        int offset = (page.getPageNo() - 1) * page.getPageSize();
        StringBuffer sqlBuffer = new StringBuffer(sql);
        sqlBuffer.append(" limit ").append(offset).append(",").append(page.getPageSize());
        return sqlBuffer.toString();
    }
}
